package com.cqut.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.cqut.model.EvaluationDetails;

public interface EvaluationDetailsMapper {
    int deleteByPrimaryKey(@Param("evaluationId") String evaluationId);

    int deleteByPrimaryKeys(@Param("primaryKeys") String[] primaryKeys);

    int insert(EvaluationDetails record);

    int insertSelective(EvaluationDetails record);

    EvaluationDetails selectByPrimaryKey(@Param("targetId") String targetId);

    int updateByPrimaryKeySelective(EvaluationDetails record);

    int updateByPrimaryKey(EvaluationDetails record);

    List<EvaluationDetails> loadModels(@Param("parameters") String parameters, @Param("condition") String condition, @Param("order") String order, @Param("sort") String sort, @Param("offset") int offset, @Param("limit") int limit);

    List<Map<String, Object>> loadMaps(@Param("parameters") String parameters, @Param("condition") String condition, @Param("order") String order, @Param("sort") String sort, @Param("offset") int offset, @Param("limit") int limit);

    long count(@Param("parameters") String parameters, @Param("condition") String condition, @Param("isDistinct") boolean isDistinct);

    EvaluationDetails findModel(@Param("targetId") String targetId, @Param("parameters") String parameters);

    Map<String, Object> findMap(@Param("targetId") String targetId, @Param("parameters") String parameters);

    List<Map<String, Object>> getEvaluationListByEvaluationName(
    		@Param("parentId")
			String parentId,
			@Param("evaluationId")
			String evaluationId, 
			@Param("evaluationName")
			String evaluationName, 
			@Param("start")
			int start,
			@Param("end")
			int end);

	long getCountByEvaluationName(
			@Param("parentId")
			String parentId,
			@Param("evaluationId")
			String evaluationId,
			@Param("evaluationName")
			String evaluationName);
	
	String getNameByUserId(
			@Param("createrId")
			String createrId);

	Map<String, Object> getMaxTargetId();

	Map<String, Object> findDetailById(
			@Param("targetId")
			String targetId);
	
	List<Map<String, Object>> findUsageById(
			@Param("reviewVersionId")
			String reviewVersionId, 
			@Param("competitionName")
			String competitionName,
			@Param("start")
			int start, 
			@Param("end")
			int end);

	long findUsageCount(
			@Param("reviewVersionId")
			String reviewVersionId, 
			@Param("competitionName")
			String competitionName);

	int deleteWholeEvaluation_1(
		@Param("evaluationId")
		String evaluationId);
	
	int deleteWholeEvaluation_2(
			@Param("evaluationId")
			String evaluationId);

	List<Map<String, Object>> getVersionListById(@Param("evaluationId") String evaluationId);

	int deleteOneEvaluation(@Param("evaluationId") String evaluationId);

}
